#ifndef __SINGLETON_H__
#define __SINGLETON_H__

#include <memory>

//单例模式封装
template<class T>
class Singleton
{
public:
    static T* GetInstance()
    {
        static T v;
        return &v;
    }
};

//单例智能指针封装
template<class T>
class SingletonPtr
{
public:
    static std::shared_ptr<T> GetInstance()
    {
        static std::shared_ptr<T> v = std::make_shared<T>();
        return v;
    };
};


#endif //__SINGLETON_H__